package com.firemoss.atonement.mapper
{
	import com.firemoss.atonement.metadata.Property;
	
	/**
	 * Default implementation of IGraphedInstanceFactory that simply
	 * creates a new instance of whatever the target property's type
	 * may be.
	 */
	public class DefaultGraphedInstanceFactory implements IGraphedInstanceFactory
	{
		public function DefaultGraphedInstanceFactory()
		{
		}
		
		public function createByTargetProperty(source:*, targetProperty:Property):*
		{
			return createByTargetClass( source, targetProperty.type.clazz )
		}
		
		public function createByTargetClass(source:*, targetClass : Class):*
		{
			return new targetClass()
		}
	}
}